<?php
include("connection/connection.php");
$typeScheme=$_POST['typeScheme'];
$frm=$_POST['frmId'];
if(isset($_POST['submit']))
{
$str=$_POST['str'];
$reserv_id=$_POST['reserv_id'];
$qr="update tbl_dtls_q1_reserv set reserv_location = '$_REQUEST[Location]' , reserv_latitude = '$_REQUEST[Longitude]' , reserv_longitude = '$_REQUEST[Latitude]' , reserv_cap='$_REQUEST[cap]',reserv_scst='$_REQUEST[scst]' where id='$reserv_id' and reserv_id LIKE '$str%' ";
$res=mysql_query($qr);

////////////////////////code for maintaining user history///////////////////
	if($typeScheme=="P&T" || $typeScheme=="TSS(P&T)")
	{
		$qryHistory="insert into tbl_new_user_history(user_id,form_id,action_id,ip_address,modify_date,user_type,user_name) values('$_POST[loginId]','$frm','12','$_SERVER[REMOTE_ADDR]',NOW(),'$_POST[userType]','$_POST[name]')";
	}
	if($typeScheme=="Piped")
	{
		$qryHistory="insert into tbl_new_user_history(user_id,form_id,action_id,ip_address,modify_date,user_type,user_name) values('$_POST[loginId]','$frm','38','$_SERVER[REMOTE_ADDR]',NOW(),'$_POST[userType]','$_POST[name]')";
	}
	if($typeScheme=="Sanitary Diggs")
	{
		$qryHistory="insert into tbl_new_user_history(user_id,form_id,action_id,ip_address,modify_date,user_type,user_name) values('$_POST[loginId]','$frm','64','$_SERVER[REMOTE_ADDR]',NOW(),'$_POST[userType]','$_POST[name]')";
	}
	
	
	mysql_query($qryHistory);
	///////////////////////////////
if($res)
{
header("location:q1.php");
}
}		
?>